package org.jeecg.modules.activiti.enums;

/**
 * @author wmf
 *  流程节点参与人枚举
 */
public enum ActNodeEnum {

    // 角色、选择人员、费用承担部门负责人、费用承担分管领导、发起人、发起人的部门负责人、发起人的部门分管领导、表单变量
    ROLE(0,"角色"),
    COSTDEPTMANAGE(1,"费用承担部门负责人"),
    COSTDEPTLEADERS(2,"费用承担分管领导"),
    STARTER(3,"发起人"),
    STARTERDEPTMANAGER(4,"发起人的部门负责人"),
    STARTERDEPTLEADERS(5,"发起人的部门分管领导"),
    USER(6,"选择人员"),
    VARIABLE(7,"表单变量");

    private Integer code;
    private String  name;

    ActNodeEnum(Integer code, String name){
        this.code = code;
        this.name = name;
    }

    public static ActNodeEnum formCodeNode(Integer code){
        for (ActNodeEnum actNodeEnum : ActNodeEnum.values()){
            if (actNodeEnum.getCode().intValue() == code.intValue()){
                return actNodeEnum;
            }
        }
        return null;
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }
}
